# -*- coding: utf-8 -*-
"""
Created on Thu Nov 19 10:19:47 2015

@author: liliangrong
"""

filename = raw_input("please input the filename of need open!")

print "Opening the file ..."
target = open(filename,'w')

print "Truncating the file. Goodbye!"
target.truncate()   #清空文件

print "Now I`m going to ask you for three lines."

line1 = raw_input("line1:")
line2 = raw_input("line2:")
line3 = raw_input("line3:")

print "I`m going to write these to the file."

line = line1+"\n"+line2+"\n"+line3+"\n"
target.write(line)

print "And finally,we close it."
target.close()